﻿
<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <!--<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0'/>-->
    <script type="text/javascript">
        var phoneWidth = parseInt(window.screen.width);
        var phoneScale = phoneWidth / 640;
        var ua = navigator.userAgent;
        if (/Android (\d+\.\d+)/.test(ua)) {
            var version = parseFloat(RegExp.$1);
            // andriod 2.3
            if (version > 2.3) {
                document.write('<meta name="viewport" content="width=640, minimum-scale = ' + phoneScale + ', maximum-scale = ' + phoneScale + ', target-densitydpi=device-dpi">');
                // andriod 2.3以上
            } else {
                document.write('<meta name="viewport" content="width=640, target-densitydpi=device-dpi">');
            }
            // 其他系统
        } else {
            document.write('<meta name="viewport" content="width=640, user-scalable=no, target-densitydpi=device-dpi">');
        }
    </script>
    <title>告白气球</title>
    <script src="js/html5shiv.min.js" type="text/javascript"></script>
    <link href="css/animate.min.css" rel="stylesheet" type="text/css">
    <link href="css/css.css" rel="stylesheet" type="text/css">
    <link href="css/swiper.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" id="pageloader-css" href="css/pageloader.css" type="text/css" media="all" />
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <!-- Link Swiper's CSS -->
    <script src="js/loading.js" type="text/javascript"></script>
    <style>
    </style>
</head>

<body>
<audio loop src="images/01.mp3" id="audio" autoplay preload="auto"></audio>
<div class="music"><img class="music-img ro" src="images/music.png">
    <div class="music-p"><img src="images/music.gif"></div>
</div>
<!--加载 -->
<div id="bonfire-pageloader">
    <div class="bonfire-pageloader-icon">
        <img src="images/loadgif.gif" />
    </div>
</div>
<!--加载 -->


<div class="zb" style="position:absolute;top:0;z-index:999;font-size:2rem;display:none">
    <p> 坐标: (beta=<span id="beta" class="value">null</span>, gamma=<span id="gamma" class="value">null</span>, alpha=<span id="alpha" class="value">null</span>, 滚动背景值=
        <span id="lefts">null</span>,屏幕宽=<span id="bjk">null</span>,移动屏幕比=<span id="pmb">null</span>,开关=<span id="open">null</span>,</p>
</div>
<div class="swiper-container SwiperBig">
    <div class="swiper-wrapper">

        <!--p1-->
        <div class="swiper-slide p1 swiper-no-swiping">
            <div class="p1-box">
                <div class="p1-text">戳破气球，看看会发生什么？</div>
                <div class="p1_ball"><img src="images/ball.png" /></div>
                <div class="ball_boomdiv"></div>
                <div class="p1_ballx"><img src="images/ball-x.png" /></div>
                <div class="p1-cloud"><img src="images/cloud.png" /></div>
                <!--p1-1-->
                <div class="ball01 "><img src="images/orange-ball.png" /></div>
                <div class="ball02"><img src="images/red-ball.png" /></div>
                <div class="ball03"><img src="images/pink-ball.png" /></div>
                <div class="ball04"><img src="images/yellow-ball.png" /></div>
            </div>
        </div>
        <!--p2-->
        <div class="swiper-slide">
            <div class="p2-box">
                <div class="p2-centerBox">
                    <div class="p2-centerImg"></div>
                </div>
                <div class="p2-text01"></div>
                <div class="p2-text02"></div>
                <div class="p2-cloudLeft"></div>
                <div class="p2-cloudHeart"></div>
                <div class="p2-cloudRight"></div>
            </div>
        </div>
        <!--p3-->
        <div class="swiper-slide">
            <div class="p3-box">
                <div class="bj">
                    <div class="bj01 on"></div>
                    <div class="bj02 hide"></div>
                </div>
                <div class="p3-text">
                    <p>彩虹走廊 —“穿越七彩的时光来遇见你”</p>
                    <P>汇金星力城 1F 中庭</P>
                </div>
                <div class="p3-num">您已穿越：<span id="cy-num">1</span>光年</div>
                <div class="p3-phone">
                    <img src="images/phoneGIF.gif" />
                    <p>左右翻转试一试</p>
                </div>
            </div>
        </div>
        <!--p4-->
        <div class="swiper-slide">
            <div class="p4-box">
                <div class="p4-yiy01 on"></div>
                <div class="p4-yiy02 hide"></div>
                <div class="p4-text"><img src="images/P4-text.png" /></div>
                <div class="p4-text02"><img src="images/P4-text02.png" /></div>
            </div>
        </div>
        <!--p5-->
        <div class="swiper-slide swiper-no-swiping">
            <div class="p5-box">
                <div class="p5-text">你是第<span>534</span>位 “热气球”升空助力者</div>
                <div class="p5-Time hide">倒计时<span>15</span>秒</div>
                <div class="p5-heart"></div>
                <div class="p5-jt"></div>
                <div class="p5-ball"></div>
                <div class="p5-ball02"></div>
                <div class="p5-light"></div>
                <div class="p5-light2"></div>
                <div class="p5-light3"></div>
                <div class="p5-light4"></div>
                <div class="p5-btn"><img src="images/p5-btn.png" /></div>
            </div>
        </div>
        <!--p7-->
        <div class="swiper-slide">
            <div class="p7-box">
                <div class="swiper-container p7-swiper" style="margin-top:42%;">
                    <div class="swiper-wrapper">
                        <div class="swiper-slide"><img src="images/p7-1.jpg" /></div>
                        <div class="swiper-slide"><img src="images/p7-2.jpg" /></div>
                        <div class="swiper-slide"><img src="images/p7-3.jpg" /></div>
                        <div class="swiper-slide"><img src="images/p7-4.jpg" /></div>
                    </div>
                </div>

            </div>
        </div>

        <!--p6-->
        <div class="swiper-slide swiper-no-swiping">
            <div class="p6-box">
                <div class="p6-centerBox">
                    <div class="p6-centerImg"></div>
                </div>
                <div class="p6-text01"></div>
                <div class="p6-text02"></div>
                <div class="p6-img1"><img src="images/P6-m1.png" /></div>
                <div class="p6-img2"><img src="images/P6-m2.png" /></div>
                <div class="p6-end"></div>
            </div>
        </div>
    </div>
</div>
<script src="js/swiper.min.js" type="text/javascript"></script>
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript"></script>
<script src="js/pageloader.js" type="text/javascript"></script>

<script>
    $(".p1_ball").bind("click", function() {
        $(this).hide();
        $(".ball_boomdiv").show().addClass("ball_boom");
        $(".p1_ballx,.p1-text").hide();
        setTimeout(function() {
            $(".ball01").addClass("ball_ani").css({
                "display": "block",
                "opacity": "1"
            })
        }, 500);
        setTimeout(function() {
            $(".ball02").addClass("ball_ani").css({
                "display": "block",
                "opacity": "1"
            })
        }, 1000);
        setTimeout(function() {
            $(".ball03").addClass("ball_ani").css({
                "display": "block",
                "opacity": "1"
            })
        }, 1300);
        setTimeout(function() {
            $(".ball04").addClass("ball_ani").css({
                "display": "block",
                "opacity": "1"
            })
        }, 1600);
        setTimeout(function() {
            swiper.slideTo(1, 1500, true);
            $(".ball01,.ball02,.ball03,.ball04").hide();
        }, 4300)
    })

    function DJ_time() {
        var djs = $(".p5-Time span").text();
        $(".p5-Time").show();
        $(".p5-Time span").text($(".p5-Time span").text() - 1);
        if ($(".p5-Time span").text() <= 0) {
            $(".p5-Time span").text(0);
        }
    }
    $(".p5-btn").one("click", function() {
        $(".p5-heart").addClass("hear_ball-ani");
        $(".p5-jt").show();
        var aj = setInterval("DJ_time()", 1000)
        $(".p5-heart").css("background", "url(images/heartBal.png) -3% 0 no-repeat")
        setTimeout(function() {
            $(".p5-heart").css("background", "url(images/heartBal.png) 32% 0 no-repeat")
        }, 5000)
        setTimeout(function() {
            $(".p5-heart").css("background", "url(images/heartBal.png) 66.5% 0 no-repeat")
        }, 9000)
        setTimeout(function() {
            $(".p5-heart").css("background", "url(images/heartBal.png) 101% 0 no-repeat");
        }, 15000)
        setTimeout(function() {
            $(".p5-ball,.p5-ball02").hide();
            $(".p5-heart").removeClass("hear_ball-ani");
            $(".p5-light,.p5-light2,.p5-light3,.p5-light4").hide();
            alert("你是第534位 “热气球”升空助力者");
            swiper.slideTo(5, 1000, true);
        }, 16000)
        setTimeout(function() {
            $(".p5-ball").addClass("ballUp");
        }, 1000)
        setTimeout(function() {
            $(".p5-ball02").addClass("ballUp");
        }, 1500)
        setTimeout(function() {
            $(".p5-light").addClass("animated flash light-over").css("opacity", "1");
            $(".p5-light2").addClass("animated flash light-over").css("opacity", "1");
            $(".p5-light3").addClass("animated flash light-over").css("opacity", "1");
            $(".p5-light4").addClass("animated flash light-over").css("opacity", "1");
        }, 2500)
    })



    /*跑道*/
    setInterval(function() {
        if ($(".bj01").hasClass("on")) {
            $(".bj01").addClass("hide").removeClass("on").siblings(".bj02").removeClass("hide").addClass("on")
        } else {
            $(".bj02").addClass("hide").removeClass("on").siblings(".bj01").removeClass("hide").addClass("on")
        }
    }, 300)
    var swiper = new Swiper('.p7-swiper', {
        autoplay: 3000,
        autoplayDisableOnInteraction: false
    });

    var swiper = new Swiper('.SwiperBig', {
        mousewheelControl: true,
        direction: 'vertical',
        pagination: '.swiper-pagination',
        onSlideChangeEnd: function(swiper) {
            if (swiper.activeIndex == 0) {
                $(".p1").removeClass("swiper-no-swiping");
                $(".p1_ball").show();
                $(".p1_ballx,.p1-text").show();
            }
            /*p1*/
            if (swiper.activeIndex == 1) {
                setTimeout(
                    function() {
                        $(".p2-centerBox").addClass("animated fadeInUp").css("opacity", "1")
                    }, 200);
                setTimeout(
                    function() {
                        $(".p2-centerImg").addClass("animated swing").css("opacity", "1")
                    }, 1100);
                setTimeout(
                    function() {
                        $(".p2-text01").addClass("animated fadeInUp").css("opacity", "1")
                    }, 1900);
                setTimeout(
                    function() {
                        $(".p2-text02").addClass("animated fadeInUp").css("opacity", "1")
                    }, 2300);
                setTimeout(
                    function() {
                        $(".p2-cloudLeft").addClass("animated fadeOutLeft").css("opacity", "1")
                    }, 2800);
                setTimeout(
                    function() {
                        $(".p2-cloudRight").addClass("animated fadeOutRight").css("opacity", "1")
                    }, 2800);
                setTimeout(
                    function() {
                        $(".p2-cloudHeart").addClass("animated pulse").css("opacity", "1")
                    }, 3500);
            }
            /*p1-end*/
            else if (swiper.activeIndex == 2) {
                $("#cy-num").text(0);
            } else if (swiper.activeIndex == 3) {
                /*摇一摇*/
                setInterval(function() {
                    if ($(".p4-yiy01").hasClass("on")) {
                        $(".p4-yiy01").addClass("hide").removeClass("on").siblings(".p4-yiy02").removeClass("hide").addClass("on")
                    } else {
                        $(".p4-yiy02").addClass("hide").removeClass("on").siblings(".p4-yiy01").removeClass("hide").addClass("on")
                    }
                }, 300)

                //运动事件监听
                if (window.DeviceMotionEvent) {
                    window.addEventListener('devicemotion', deviceMotionHandler, false);
                }
                //获取加速度信息
                //通过监听上一步获取到的x, y, z 值在一定时间范围内的变化率，进行设备是否有进行晃动的判断。
                //而为了防止正常移动的误判，需要给该变化率设置一个合适的临界值。
                var SHAKE_THRESHOLD = 10000;
                var last_update = 0;
                var x, y, z, last_x = 0,
                    last_y = 0,
                    last_z = 0;
                var isOne = 0;

                function deviceMotionHandler(eventData) {
                    var acceleration = eventData.accelerationIncludingGravity;
                    var curTime = new Date().getTime();
                    if ((curTime - last_update) > 10) {
                        var diffTime = curTime - last_update;
                        last_update = curTime;
                        x = acceleration.x;
                        y = acceleration.y;
                        z = acceleration.z;
                        var speed = Math.abs(x + y + z - last_x - last_y - last_z) / diffTime * 10000;
                        if (speed > SHAKE_THRESHOLD) {
                            $(".p4-yiy01,.p4-yiy02").hide(); // Do somethingp4-box
                            setTimeout(function() {
                                $(".p4-box").css("background", "url(images/P4-bg.jpg) 33.4% 0 no-repeat")
                            }, 200);
                            setTimeout(function() {
                                $(".p4-box").css("background", "url(images/P4-bg.jpg) 66.7% 0 no-repeat")
                            }, 400);
                            setTimeout(function() {
                                $(".p4-box").css("background", "url(images/P4-bg.jpg) 100% 0 no-repeat")
                            }, 600);
                            setTimeout(function() {
                                $(".p4-text").addClass("animated fadeIn").css("opacity", "1")
                            }, 1100)
                            setTimeout(function() {
                                $(".p4-text02").addClass("animated fadeInUp").css("opacity", "1")
                            }, 1600)
                            isOne = 1;
                            if (isOne == 1) {
                                window.removeEventListener('devicemotion', deviceMotionHandler, false);
                            }
                        }
                        last_x = x;
                        last_y = y;
                        last_z = z;
                    }
                }
            }
            /*P6-begin*/
            else if (swiper.activeIndex == 6) {
                setTimeout(
                    function() {
                        $(".p6-centerBox").addClass("animated fadeInUp").css("opacity", "1")
                    }, 200);
                setTimeout(
                    function() {
                        $(".p6-centerImg").addClass("animated swing").css("opacity", "1")
                    }, 1100);
                setTimeout(
                    function() {
                        $(".p6-text01").addClass("animated fadeInUp").css("opacity", "1")
                    }, 1900);
                setTimeout(
                    function() {
                        $(".p6-text02").addClass("animated fadeInUp").css("opacity", "1")
                    }, 2300);
                setTimeout(
                    function() {
                        $(".p6-img1").addClass("animated fadeInUp").css("opacity", "1")
                    }, 2500);
                setTimeout(
                    function() {
                        $(".p6-img1 img").addClass("animated fadeInRight").css("opacity", "1")
                    }, 2600);
                setTimeout(
                    function() {
                        $(".p6-img2").addClass("animated fadeInUp").css("opacity", "1")
                    }, 2700);
                setTimeout(
                    function() {
                        $(".p6-img2 img").addClass("animated fadeInLeft").css("opacity", "1")
                    }, 2800);
                setTimeout(
                    function() {
                        $(".p6-img3").addClass("animated fadeInUp").css("opacity", "1")
                    }, 2900);
                setTimeout(
                    function() {
                        $(".p6-img3 img").addClass("animated fadeInRight").css("opacity", "1")
                    }, 3000);
                setTimeout(
                    function() {
                        $(".p6-end").show().addClass("end-anidiv")
                    }, 3800);
                setTimeout(
                    function() {
                        $(".p6-end").hide()
                    }, 4800);
            }
        }
        /*P6-end*/

    });
</script>
<script>
    //音乐类
    $(function() {
        $("#audio_btn").click(function() {
            var music = document.getElementById("music");
            if (music.paused) {
                music.play();
                $("#music_btn").attr("src", "play.png");
            } else {
                music.pause();
                $("#music_btn").attr("src", "pause.png");
            }
        });
        []
        a = $("span [class='swiper-pagination-bullet swiper-pagination-bullet-active']").index();
        //alert(a);

    })


    var audio = document.getElementById("audio");
    audio.load();
    audio.play();

    document.addEventListener("WeixinJSBridgeReady", function() {
        audio.play();
    }, false);
    $('.music').click(function() {
        if ($('.music-img').is('.ro')) {
            $('.music-img').removeClass('ro')
            $('.music-p').css('display', 'none')
            audio.pause();
        } else {
            $('.music-img').addClass('ro')
            $('.music-p').css('display', 'block')
            audio.play();
        }
    })
</script>




<!-- BEGIN PLACE LOADING ICON IN THE MIDDLE OF THE PAGE -->
<script>
    jQuery(window).resize(function() {
        resizenow();
    });

    function resizenow() {
        var browserwidth = jQuery(window).width();
        var browserheight = jQuery(window).height();
        jQuery('.bonfire-pageloader-icon').css('right', ((browserwidth - jQuery(".bonfire-pageloader-icon").width()) / 2)).css('top', ((browserheight - jQuery(".bonfire-pageloader-icon").height()) / 2));
    };
    resizenow();
</script>
</body>

</html>

